#include <iostream>

using namespace std;

// 计算的圆的周长
double get_circle_girth(double r) {
	return 2 * 3.14 * r;
}

// 计算的圆的面积
double get_circle_area(double r) {
	return 3.14 * r * r;
}

class Circle {
public:
	void setR(double r) {
		m_r = r;
	}
	double getR() {
		return m_r;
	}
	double get_girth() {
		return 2 * 3.14 * m_r;
	}
	double get_area() {
		return 3.14 * m_r * m_r;
	}
	double get_a() {
		return m_a;
	}
	double get_g() {
		return m_g;
	}
private:
	// 在申请 3 个变量的时候，它们的值是内存中随机分配的，因为m_g,m_a,得到的值也是随机的
	double m_r;
	double m_g = 2 * 3.14 * m_r;
	double m_a = 3.14 * m_r * m_r;
};

int main(int argc, char *argv[]) {

	// 圆形的半径
	double r = 10;
	double g = get_circle_girth(r);
	double a = get_circle_area(r);

	cout << "圆形半径：" << r << endl;
	cout << "圆形周长：" << g << endl;
	cout << "圆形面积：" << a << endl;

	cout << "---" << endl;

	Circle c;
	c.setR(r);
	cout << "圆形半径：" << c.getR() << endl;
	cout << "圆形周长：" << c.get_girth() << endl;
	cout << "圆形面积：" << c.get_area() << endl;
	cout << "圆形周长2：" << c.get_g() << endl;
	cout << "圆形面积2：" << c.get_a() << endl;

	return 0;
}
